<div paginate currentPage totalPage actionUrl urlParas="">
    <%if( (totalPage! <= 0) || (currentPage! > totalPage!)){%><%}%>
    <local startPage=currentPage - 4/>
    <%if (startPage < 1){%>
    <local startPage=1/><%}%>

        <local endPage=currentPage + 4/>
        <%if (endPage! > totalPage!){%>
        <div endPage=totalPage><%}%>

            <ul class="pagination">
                <%if(currentPage! <= 8){%>
                <local startPage=1/>
                    <%}%>
                    <%if ((totalPage! - currentPage!) < 8){%>
                    <local endPage=totalPage/>
                        <%}%>

                        <%if (currentPage! == 1){%>
                        <li class="paginate_button previous disabled">
                            <a href="#" data-dt-idx="0" tabindex="0">上页</a>
                        </li>
                        <%}else{%>
                        <li class="paginate_button previous">
                            <a href="${actionUrl!}#{currentPage - 1}${urlParas!}" data-dt-idx="0" tabindex="0">上页</a>
                        </li>
                        <%}%>
                        <%if (currentPage1 > 8){%>
                        <li class="paginate_button">
                            <a href="${actionUrl!}#{1}${urlParas!}" data-dt-idx="1" tabindex="0">#{1}</a>
                        </li>
                        <li class="paginate_button ">
                            <a href="${actionUrl!}#{2}${urlParas!}" data-dt-idx="2" tabindex="0">#{2}</a>
                        </li>
                        <li class="paginate_button disabled">
                            <a href="#" data-dt-idx="2" tabindex="0">…</a>
                        </li>
                        <%}%>

                        <%for( i in endPage!){%>
                        <%if (currentPage! == i){%>
                        <li class="paginate_button active">
                            <a href="#" data-dt-idx="1" tabindex="0">#{i}</a>
                        </li>
                        <%}else{%>
                        <li class="paginate_button">
                            <a href="${actionUrl}#{i}${urlParas!}" data-dt-idx="1" tabindex="0">#{i}</a>
                        </li>
                        <%}%>
                        <%}%>

                        <%if((totalPage! - currentPage!) >= 8){%>
                        <li class="paginate_button disabled">
                            <a href="#" data-dt-idx="2" tabindex="0">…</a>
                        </li>
                        <li class="paginate_button">
                            <a href="${actionUrl!}#{totalPage! - 1}${urlParas!}" data-dt-idx="1" tabindex="0">#{totalPage
                                - 1}</a>
                        </li>
                        <li class="paginate_button">
                            <a href="${actionUrl!}#{totalPage!}${urlParas!}" data-dt-idx="1"
                               tabindex="0">#{totalPage}</a>
                        </li>
                        <%}%>

                        <%if (currentPage! == totalPage!){%>
                        <li class="paginate_button next disabled">
                            <a href="#" data-dt-idx="2" tabindex="0">下页</a>
                        </li>
                        <%}else{%>
                        <li class="paginate_button next">
                            <a href="${actionUrl!}#{currentPage! + 1}${urlParas!}" data-dt-idx="2" tabindex="0">下页</a>
                        </li>
                        <%}%>
            </ul>
        </div>